package dto

import (
	"github.com/starmotioncf/common/payment"
)

type PaymentUserReq struct {
	PaymentUid uint64 `json:"-" validate:"omitempty"`
	Uid        string `json:"uid" validate:"required"`
}

type PaymentMethodReq struct {
	CountryCode int `json:"countryCode" validate:"omitempty"` //国家id
}

//type PaymentMethodItem struct {
//	model.PaymentMethodItem
//	Products []*ProductWebItem `json:"products"` //产品列表
//}

type PaymentCreateOrderReq struct {
	Uid             uint64 `json:"uid" validate:"required"`             //充值用户id
	ProductId       int64  `json:"productId" validate:"required"`       //产品id
	CountryCode     int    `json:"countryCode" validate:"omitempty"`    //国家id
	PaymentMethodId int64  `json:"paymentMethodId" validate:"required"` //支付方式id
	Ext             string `json:"ext" validate:"omitempty"`            //透传参数，不做处理
}

type PaymentQueryOrderReq struct {
	OrderNo string `json:"orderNo"  validate:"required"` //内部订单号
	TradeNo string `json:"tradeNo"  validate:"required"` //第三方支付平台订单号,要两个单号匹配，防止恶意查询
}

type PaymentQueryOrderRes struct {
	OrderNo string `json:"orderNo"` //内部订单号
	TradeNo string `json:"tradeNo"` //第三方支付平台订单号,要两个单号匹配，防止恶意查询
	IsAgent bool   `json:"isAgent"` //是否代理商订单
	//Status      constant.PaymentQueryStatus `json:"status"`      //0处理中 1支付成功 2支付失败 3关单 6完成
	Price       int64            `json:"price"`       //订单金额价值，美金
	Coin        int64            `json:"coin"`        //此次购买金币数量
	PayPrice    string           `json:"payPrice"`    //订单实际支付金额
	PayCurrency payment.Currency `json:"PayCurrency"` //订单实际支付货币单位
	Ext         string           `json:"ext"`         //透传字段
}

type PaymentPaypalReturn struct {
	Action  string `json:"-" validate:"required"`
	Token   string `json:"token" form:"token" query:"token" validate:"required"`
	PayerID string `json:"PayerID" form:"PayerID" query:"PayerID" validate:"omitempty"`
}

type PaymentCreateOrderRes struct {
	PayUrl  string `json:"payUrl"`  //支付跳转地址
	OrderNo string `json:"orderNo"` //内部订单号
	TradeNo string `json:"tradeNo"` //第三方支付平台订单号
}

//
//type PaymentOrderReceipt struct {
//	Method  *model.VcCountryPaymentMethod `json:"method"`
//	Product *model.VcProductWeb           `json:"product"`
//}
//
//type PaymentCountryRes struct {
//	All     []*CountryItem `json:"all"`
//	Hot     []*CountryItem `json:"hot"`
//	Default *CountryItem   `json:"default"`
//}

type PaymentCountryReq struct {
	Uid     uint64 `json:"uid" validate:"required"`
	IsAgent uint8  `json:"isAgent" validate:"omitempty"` // 是否代理充值 1 代理 0 普通用户
}
